import request from '@/utils/myrequest'

export function getList(kvs) {
  return request({
    url: 'config/user/getlist',
    method: 'get',
    kvs
  })
}

export function add(kvs) {
  return request({
    url: 'config/user/add',
    method: 'post',
    kvs
  })
}

export function get(kvs) {
  return request({
    url: 'config/user/get',
    method: 'get',
    kvs
  })
}

export function del(kvs) {
  return request({
    url: 'config/user/delete',
    method: 'post',
    kvs
  })
}

export function edit(kvs) {
  return request({
    url: 'config/user/update',
    method: 'post',
    kvs
  })
}

export function editUser(kvs) {
  return request({
    url: 'config/user/updateself',
    method: 'post',
    kvs
  })
}

export function getAllUsers() {
  return request({
    url: 'config/user/getall',
    method: 'get'
  })
}

export function getAllProjectUsers() {
  return request({
    url: 'config/user/GetAllUsers',
    method: 'get'
  })
}

export function UpdateAvatar(kvs) {
  return request({
    url: 'config/user/UpdateAvatar',
    method: 'post',
    kvs
  })
}

export function updatePass(kvs) {
  return request({
    url: 'config/user/updatePassword',
    method: 'post',
    kvs
  })
}
// 获取人员名单
export function getAllUserList(kvs) {
  return request({
    url: 'config/user/GetAll',
    method: 'get',
    kvs
  })
}
export function download(kvs) {
  return request({
    url: 'config/download/GetTemplate',
    method: 'get',
    kvs
  })
}

export function upload(kvs) {
  return request({
    url: 'config/upload/Submit',
    method: 'post',
    kvs
  })
}

export function getalldept(kvs) {
  return request({
    url: '/config/dept/getall',
    method: 'get',
    kvs
  })
}

export default { get, getList, add, edit, del, getAllUsers, download, upload, getAllProjectUsers }

